# 不可变类型
# tuple_val = (1,2,3)
# new_tuple = tuple_val[1:3] + (4,5,6)
# print(new_tuple)
# print(tuple_val)

# 可变类型
# 复制
# dict_val = {'name':'andy'}
# new_dict = dict_val.copy()
# dict_val['age'] = 18
# print(dict_val)
# print(new_dict)
# 循环过程中删除可变类型元素引发的bug
# data = [11,22,33,44,55,66,77]
# for i in data:
#     if i == 33 or i == 44:
#         data.remove(i)
# print(data)

data = [11,22,33,44,55,66,77]
list_temp = []
for i in data:
    if i == 33 or i == 44:
        # data.remove(i)
        list_temp.append(i)
print(list_temp)

for i in list_temp:
    if i == 33 or i == 44:
        data.remove(i)  # [11,22,55,66,77]
print(data)